package com.gjj.echarts.echartsgjj.controller;

import com.gjj.echarts.echartsgjj.service.OneYearService;
import com.gjj.echarts.echartsgjj.vo.OneYearVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class IndexController {
    @Autowired
    OneYearService oneYearService;

    @GetMapping("/")
    public String index(Model model){
        OneYearVo vo = oneYearService.selectOneYear();
        model.addAttribute("year",vo);
        return "main";
    }

    @GetMapping("/index")
    public String indexMain(Model model){
        OneYearVo vo = oneYearService.selectOneYear();
        model.addAttribute("year",vo);
        return "main";
    }

    @GetMapping("/test")
    public String test(Model model){
        OneYearVo vo = oneYearService.selectOneYear();
        model.addAttribute("year",vo);
        return "money_table";
    }
}
